package com.hgw.rocketmqtemplatedemo.listener;

import org.apache.rocketmq.spring.core.RocketMQListener;

/**
 * Description: 消费者监听器
 * 过滤条件：携带a属性且 a >=6 && a<=9
 *
 * @author LinHuiBa-YanAn
 * @date 2023/2/15 20:18
 */
/*@Component
@RocketMQMessageListener(
        consumerGroup = "demo-consumer-group",      // consumerGroup：消费者组名
        topic = "Demo",                             // topic：订阅的主题
        selectorType = SelectorType.SQL92,          // selectorType：那种模式选择消息
        selectorExpression = "a BETWEEN 6 AND 9",   // selectorExpression：控制可以选择的消息，可以使用SelectorType.SQL92语法。设置为 * 时，表示全部。
        messageModel = MessageModel.CLUSTERING      // messageModel: 控制消息模式。MessageModel.CLUSTERING：负载均衡；MessageModel.BROADCASTING：广播模式
)*/
public class MqSQL92ConsumerListener implements RocketMQListener<Object> {

    @Override
    public void onMessage(Object message) {
        System.out.println("消费消息-" + message);
    }

}
